import java.util.Date;
import java.util.Random;
import java.util.Scanner;

public class KEsimoApp {

	/**
	 * 
	 * @param args
	 */

	public static void main(String[] args) {

		int numeros[] = new int[100];
		Date hoy = new Date();
		Random rnd = new Random(hoy.getTime());

		for (int i = 0; i < numeros.length; i++)
			numeros[i] = rnd.nextInt(100);

		Scanner sc = new Scanner(System.in);

		int k;
		System.out.print("K: ");
		k = sc.nextInt();

		boolean encontrado = false;

		for (int i = 0; !encontrado && i < numeros.length; i++) {

			int mayores = 0;

			for (int j = 1; mayores <= k && j < numeros.length; j++)

				if (numeros[j] > numeros[i])
					mayores++;

			if (mayores == k - 1) {
				encontrado = true;
				System.out.println(numeros[i]);
			}

		}

		for (int i = 0; i < numeros.length; i++)

			System.out.print(numeros[i] + " ");

	}

}
